import mitt from 'mitt'
import initDebug from './debug'
import initWorkspace from './worksapce'
import initResource from './resource'

export * from './debug'
export * from './worksapce'
export * from './resource'

/**
 * 事件总线
 */
const emitter = mitt()

export default function useElectron(app) {
  app.config.globalProperties.$emitter = emitter

  if (window.api) {
    initDebug(emitter)
    initWorkspace(emitter)
    initResource(emitter)
  }
}
